text = "Hello 世界 🐍"

print(f"原始字符串: {text}")

# 编码为字节
utf8_bytes = text.encode('utf-8')
gbk_bytes = text.encode('gbk', errors='ignore')

print(f"UTF-8字节: {utf8_bytes}")
print(f"GBK字节: {gbk_bytes}")

# 解码回字符串
decoded_utf8 = utf8_bytes.decode('utf-8')
decoded_gbk = gbk_bytes.decode('gbk')

print(f"UTF-8解码: {decoded_utf8}")
print(f"GBK解码: {decoded_gbk}")

# 字符和编码点
for char in "ABC世界":
    print(f"字符 '{char}' -> Unicode码点: {ord(char):04X}")